<?php

class DepartmentManager extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
	}
	
	function index() # my requisitions
	{
		$data['links'] = $this->side_menu();
		$data['content'] = $this->load->view("departmentmanager/requisitions_view", $data, true);
		
		$data['title'] = array( "My Dashboard", "My Requisitions" );
		$this->load->view("main_view", $data);	
	}
	
	function pending_materials()
	{
		$data['links'] = $this->side_menu();
		$data['content'] = $this->load->view("departmentmanager/pending_materials_view", $data, true);
		
		$data['title'] = array( "My Dashboard", "My Pending Materials" );
		$this->load->view("main_view", $data);	
	}
	
	function purchase_orders()
	{
		$data['links'] = $this->side_menu();
		$data['content'] = $this->load->view("departmentmanager/purchase_orders_view", $data, true);
		
		$data['title'] = array( "My Dashboard", "Purchase Orders" );
		$this->load->view("main_view", $data);	
	}
	
	function receiving_reports()
	{
		$data['links'] = $this->side_menu();
		$data['content'] = $this->load->view("departmentmanager/receiving_reports_view", $data, true);
		
		$data['title'] = array( "My Dashboard", "Receiving Reports" );
		$this->load->view("main_view", $data);	
	}
	
	function total_requisitions()
	{
		$data['links'] = $this->side_menu();
		$data['content'] = $this->load->view("departmentmanager/total_requisitions_view", $data, true);
		
		$data['title'] = array( "My Dashboard", "Total Requisitions" );
		$this->load->view("main_view", $data);	
	}
	
	function top_suppliers()
	{
		$data['links'] = $this->side_menu();
		$data['content'] = $this->load->view("departmentmanager/top_suppliers_view", $data, true);
		
		$data['title'] = array( "My Dashboard", "Top Suppliers" );
		$this->load->view("main_view", $data);	
	}
	
	private function side_menu(){
	
		return (object)array(
			'dashboard' => (object)array(
				'My Requisitions'      => './',
				'My Pending Materials' => './pending_materials',
				'Purchase Orders'      => './purchase_orders',
				'Receiving Reports'    => './receiving_reports'
			),
			'reports'   => (object)array(
				'Total Requisitions' => './total_requisitions',
				'Top Suppliers'      => './top_suppliers'
			)
		);
		
	}
}